<template>
  <div class="cm-nums-out">
    <div class="cm-num-wrap w1180">
      <div class="cm-num-box">
        <div class="cm-countup">
          <Count-To :startVal="0" :endVal="data.integrals" :duration="1500" />
        </div>
        <p class="cm-num-desc">累计积分</p>
      </div>
      <div class="cm-num-box">
        <div class="cm-countup">
          <Count-To :startVal="0" :endVal="data.projects" :duration="1500" />
        </div>
        <p class="cm-num-desc">项目数量</p>
      </div>
      <div class="cm-num-box">
        <div class="cm-countup">
          <Count-To :startVal="0" :endVal="data.users" :duration="1500" />
        </div>
        <p class="cm-num-desc">注册开发者</p>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { CountTo } from 'vue3-count-to'
defineProps(['data'])
</script>

<style scoped>
.cm-nums-out {
  background: #f7f8f9;
  height: 160px;
  .cm-num-wrap {
    display: flex;
    align-items: center;
    text-align: center;
    height: 100%;
  }
  .w1180 {
    max-width: 1180px;
    margin: 0 auto;
  }
  .cm-num-box {
    flex: 1;
    text-align: center;
  }

  .cm-countup {
    height: 55px;
    font-size: 36px;
    color: #3388e9;
    font-weight: 700;
  }
  .cm-num-desc {
    font-size: 16px;
    color: #6a6e77;
    padding-top: 10px;
  }
}
</style>
